<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:f="http://java.sun.com/jsf/core" 
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:a4j="http://richfaces.org/a4j" 
	  xmlns:rich="http://richfaces.org/rich"
	  xmlns:c="http://java.sun.com/jstl/core" 
	  xmlns:sec="http://www.springframework.org/security/facelets/tags">

<h:form id="form" rendered="#{!menuMB.primeiroAcesso}">
    <h:panelGrid columns="2" columnClasses="cols,cols" width="400">
    <rich:panelMenu style="width:200px"  mode="ajax" 
        iconExpandedGroup="disc" iconCollapsedGroup="disc" 
        iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right" 
        iconCollapsedTopGroup="chevronDown">

        <rich:panelMenuGroup label="#{msg.inboxes}" expanded="true">
            <rich:panelMenuItem label="#{msg.meuInbox}" actionListener="#{menuMB.navegarToPagina}">
            	<a4j:actionparam name="selecionaPaginaForm" value="/inboxes/meuInboxMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
            </rich:panelMenuItem>
			<sec:ifAnyGranted roles="ROLE_ADMIN">
	            <rich:panelMenuItem label="#{msg.inboxGeralTecnico}" actionListener="#{menuMB.navegarToPagina}">
	            	<a4j:actionparam name="selecionaPaginaForm" value="/inboxes/inboxGeralTecnicoMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
            </sec:ifAnyGranted>
			<sec:ifAnyGranted roles="ROLE_ADMIN,ROLE_TECNICO">
	            <rich:panelMenuItem label="#{msg.inboxGeral}" actionListener="#{menuMB.navegarToPagina}">
	            	<a4j:actionparam name="selecionaPaginaForm" value="/inboxes/inboxGeralMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
            </sec:ifAnyGranted>
        </rich:panelMenuGroup>        
		
		<sec:ifAnyGranted roles="ROLE_ADMIN">
	        <rich:panelMenuGroup label="#{msg.cadastros}" expanded="true">
	            <rich:panelMenuItem label="#{msg.usuario}" actionListener="#{menuMB.navegarToPagina}">
	            	<a4j:actionparam name="selecionaPaginaForm" value="pessoaMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.instituicoes}" actionListener="#{menuMB.navegarToPagina}">
	                <a4j:actionparam name="selecionaPaginaForm" value="instituicaoMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.perifericos}" actionListener="#{menuMB.navegarToPagina}">
	                <a4j:actionparam name="selecionaPaginaForm" value="perifericoMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.equipamento}" actionListener="#{menuMB.navegarToPagina}">
	                <a4j:actionparam name="selecionaPaginaForm" value="/cadastros/equipamentoMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>            
	<!--            <rich:panelMenuItem label="#{msg.botaoCriarOcorrencia}" onclick="javascript:window.open('','nomeCriarOcorrencia','height=480,width=640,toolbar=no,scrollbars=no')"-->
	<!--           	target="nomeCriarOcorrencia"  action="criarOcorrenciaMBForm" />-->
	        </rich:panelMenuGroup>
        </sec:ifAnyGranted>

		<sec:ifAnyGranted roles="ROLE_ADMIN,ROLE_TECNICO">        
	        <rich:panelMenuGroup label="#{msg.relatorio}">
	            <rich:panelMenuItem label="#{msg.ocorrenciaPorLaboratorio}" actionListener="#{menuMB.navegarToPagina}">
	                <a4j:actionparam name="selecionaPaginaForm" value="/pages/relatorios/ocorrenciaPorLaboratorioMBean.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.ocorrenciaEmAtraso}" actionListener="#{menuMB.navegarToPagina}">
	                <a4j:actionparam name="selecionaPaginaForm" value="/pages/relatorios/ocorrenciaEmAtrasoMBean.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.ocorrenciaPorEquipamento}" actionListener="#{menuMB.navegarToPagina}">
	                <a4j:actionparam name="selecionaPaginaForm" value="/pages/relatorios/ocorrenciaPorEquipamentoMBean.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.ocorrenciaPorTecnicos}" actionListener="#{menuMB.navegarToPagina}">
	                <a4j:actionparam name="selecionaPaginaForm" value="/pages/relatorios/ocorrenciaPorTecnicosMBean.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>            
	        </rich:panelMenuGroup>
        </sec:ifAnyGranted>
        
   		<sec:ifAnyGranted roles="ROLE_ADMIN">
	        <rich:panelMenuGroup label="#{msg.painelcontrole}">
	            <rich:panelMenuItem label="#{msg.status}" actionListener="#{menuMB.navegarToPagina}">
	            	<a4j:actionparam name="selecionaPaginaForm" value="/admin/painelcontrole/statusMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.nomePeriferico}" actionListener="#{menuMB.navegarToPagina}">
	            	<a4j:actionparam name="selecionaPaginaForm" value="/admin/painelcontrole/nomePerifericoMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.sala}" actionListener="#{menuMB.navegarToPagina}">
	            	<a4j:actionparam name="selecionaPaginaForm" value="/admin/painelcontrole/salaMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>
	            <rich:panelMenuItem label="#{msg.setor}" actionListener="#{menuMB.navegarToPagina}">
	            	<a4j:actionparam name="selecionaPaginaForm" value="/admin/painelcontrole/setorMBForm.xhtml" assignTo="#{menuMB.selecionaPaginaForm}"/>
	            </rich:panelMenuItem>            
	        </rich:panelMenuGroup>
        </sec:ifAnyGranted>
    </rich:panelMenu>
    </h:panelGrid>
 </h:form>

</html>